package org.railage.server.dao;

import org.railage.server.entities.User;

/**
 * DAO for User entity.
 * 
 * @author Cyril Fertikov
 * 
 */
public interface UserDAO {

	/**
	 * Adds new user.
	 * 
	 * @param user
	 *            User object.
	 * @return New user's ID or -1 if DB session error occurred.
	 */
	int addUser(User user);

	/**
	 * Gets user by login and password.
	 * 
	 * @param login
	 *            Login.
	 * @param password
	 *            Password.
	 * @return User object.
	 */
	User getUserByLoginPassword(String login, String password);

	/**
	 * Gets user by surname, name and birthday.
	 * 
	 * @param surname
	 *            Surname.
	 * @param name
	 *            Name.
	 * @param birthday
	 *            Birthday.
	 * @return User object.
	 */
	User getUserByPersonalInfo(String surname, String name, String birthday);
}
